//
//  ChangeString.m
//  网络封装(Xcode7)
//
//  Created by dllo on 15/9/30.
//  Copyright © 2015年 Fan. All rights reserved.
//

#import "ChangeString.h"

@implementation ChangeString
+ (NSDictionary *)getDictionaryByString:(NSString *)string
{
    //将字符串按&分割
    NSArray *array = [string componentsSeparatedByString:@"&"];
    //初始化一个字典
    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    //遍历数组
    for (NSString *str in array) {
        NSArray *arr = [str componentsSeparatedByString:@"="];
        [dic setValue:arr[1] forKey:arr[0]];
    }
    return dic;
}
@end
